x86/emul: Always use fault semantics for software events
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Nov 2016 11:45:41 +0000 (11:45 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Dec 2016 17:23:01 +0000 (17:23 +0000)
commit346f43dbf36856f5ad030b229592283ce44af1d4
tree78fd6918a1de6b5c97b8c880eec521f628ac82a8
parent3e84c8da7d2c5442a12789dae7163dca6c0e154f
x86/emul: Always use fault semantics for software events

The common case is already using fault semantics out of x86_emulate(), as that
is how VT-x/SVM expects to inject the event (given suitable hardware support).

However, x86_emulate() returning X86EMUL_EXCEPTION and also completing a
register writeback is problematic for callers.

Switch the logic to always using fault semantics, and leave svm_inject_trap()
to fix up %eip if necessary.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h